package com.ruoyi.newsCategorySys.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.newsCategorySys.mapper.TbNewsCategoryMapper;
import com.ruoyi.newsCategorySys.domain.TbNewsCategory;
import com.ruoyi.newsCategorySys.service.ITbNewsCategoryService;

/**
 * 新闻分类Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-11-06
 */
@Service
public class TbNewsCategoryServiceImpl implements ITbNewsCategoryService 
{
    @Autowired
    private TbNewsCategoryMapper tbNewsCategoryMapper;

    /**
     * 查询新闻分类
     * 
     * @param id 新闻分类主键
     * @return 新闻分类
     */
    @Override
    public TbNewsCategory selectTbNewsCategoryById(Long id)
    {
        return tbNewsCategoryMapper.selectTbNewsCategoryById(id);
    }

    /**
     * 查询新闻分类列表
     * 
     * @param tbNewsCategory 新闻分类
     * @return 新闻分类
     */
    @Override
    public List<TbNewsCategory> selectTbNewsCategoryList(TbNewsCategory tbNewsCategory)
    {
        return tbNewsCategoryMapper.selectTbNewsCategoryList(tbNewsCategory);
    }

    /**
     * 新增新闻分类
     * 
     * @param tbNewsCategory 新闻分类
     * @return 结果
     */
    @Override
    public int insertTbNewsCategory(TbNewsCategory tbNewsCategory)
    {
        return tbNewsCategoryMapper.insertTbNewsCategory(tbNewsCategory);
    }

    /**
     * 修改新闻分类
     * 
     * @param tbNewsCategory 新闻分类
     * @return 结果
     */
    @Override
    public int updateTbNewsCategory(TbNewsCategory tbNewsCategory)
    {
        return tbNewsCategoryMapper.updateTbNewsCategory(tbNewsCategory);
    }

    /**
     * 批量删除新闻分类
     * 
     * @param ids 需要删除的新闻分类主键
     * @return 结果
     */
    @Override
    public int deleteTbNewsCategoryByIds(Long[] ids)
    {
        return tbNewsCategoryMapper.deleteTbNewsCategoryByIds(ids);
    }

    /**
     * 删除新闻分类信息
     * 
     * @param id 新闻分类主键
     * @return 结果
     */
    @Override
    public int deleteTbNewsCategoryById(Long id)
    {
        return tbNewsCategoryMapper.deleteTbNewsCategoryById(id);
    }
}
